package com.yupi.yuoj.judge.codesandbox.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ExecuteCodeRequest {

    private List<String> inputList;

    private String code;

    private String language;

    // 手动添加getter/setter方法以解决编译问题
    public List<String> getInputList() {
        return inputList;
    }

    public void setInputList(List<String> inputList) {
        this.inputList = inputList;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    // 手动添加builder方法以解决编译问题
    public static ExecuteCodeRequestBuilder builder() {
        return new ExecuteCodeRequestBuilder();
    }

    public static class ExecuteCodeRequestBuilder {
        private List<String> inputList;
        private String code;
        private String language;

        public ExecuteCodeRequestBuilder inputList(List<String> inputList) {
            this.inputList = inputList;
            return this;
        }

        public ExecuteCodeRequestBuilder code(String code) {
            this.code = code;
            return this;
        }

        public ExecuteCodeRequestBuilder language(String language) {
            this.language = language;
            return this;
        }

        public ExecuteCodeRequest build() {
            ExecuteCodeRequest request = new ExecuteCodeRequest();
            request.setInputList(this.inputList);
            request.setCode(this.code);
            request.setLanguage(this.language);
            return request;
        }
    }
}
